//initalize state of toggling tree
toggleWholeTree();


//the first site that is marked when it is loaded
var startUrl = document.URL.split("=");
var prevMarked;
if(startUrl.length > 1 && !Number.isInteger(startUrl[1])) {
	prevMarked = document.getElementById(startUrl[1]);
	if(prevMarked == null){
		prevMarked = document.getElementById("start");
		underLineText(document.getElementById("start"));	
	}else{
		underLineText(document.getElementById(startUrl[1]));
	}
}else{
	prevMarked = document.getElementById("start");
	underLineText(document.getElementById("start"));	
}

var _SESSION = {};
_SESSION["currentPage"] = document.URL;

//if there is no content, dont show the contentarea
var contentArea = document.getElementById("realContent");
$('#contentAreaWrapper').toggle(contentArea.innerHTML.trim().length !== 0);

//if there is nothing in menu, hide it
var menuArea = document.getElementById("leftList");
if(menuArea.innerHTML.trim().length !== 0) {
	$('#leftMenu').toggle(true);
	$('#contentAreaWrapper').width("calc(100% - (340px))");
	$('#contentAreaWrapper').css("left", "200px");
}else{
	$('#leftMenu').toggle(false);
	$('#contentAreaWrapper').width("100%");
	$('#contentAreaWrapper').css("left", "0px");
}